﻿// See https://aka.ms/new-console-template for more information
using System;
class Calculate
{
    static void add(double x, double y)
    {
        double z = x + y;
        Console.WriteLine(z);
    }
    static void sub(double x, double y)
    {
        double z = x - y;
        Console.WriteLine(z);
    }
    static void mul(double x, double y)
    {
        double z = x * y;
        Console.WriteLine(z);
    }
    static void div(double x, double y)
    {
        double z = x / y;
        Console.WriteLine(z);
    }
    static void mod(double x, double y)
    {
        double z = x % y;
    }


    static void Main(String[] args)
    {
        Console.WriteLine("请输入两个数");
        String s = Console.ReadLine();
        double a = Double.Parse(s);
        s = Console.ReadLine();
        double b = Double.Parse(s);
        Console.WriteLine("请输入运算符号");
        s = Console.ReadLine();
        char c = Char.Parse(s);
        if (c == '+')
        {
            Console.WriteLine("两数相加结果为：");
            add(a, b);
        }
        else if (c == '-')
        {
            Console.WriteLine("两数相减结果为：");
            sub(a, b);
        }
        else if (c == '*')
        {
            Console.WriteLine("两数相乘结果为：");
            mul(a, b);
        }
        else if (c == '/')
        {
            Console.WriteLine("两数相除结果为：");
            div(a, b);
        }
        else if (c == '%')
        {
            Console.WriteLine("两数取模结果为：");
                mod(a, b);
        }
        else
            Console.WriteLine("运算符号输入错误！");

    }
}
